home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Games Collection 1 / software vault.zip / software vault / CDR03 / XBRF.ZIP / XBRFASM.TXT < prev   
Text File  |  1993-08-29  |  22KB  |  487 lines

  1. +---------------------------------------------------------------------------+
  2. |                                                                           |
  3. |  X-Wing Briefing Assembler Kit                                            |
  4. |                                                                           |
  5. |                 Written by Tim Scott (tscott@plains.nodak.edu)            |
  6. |                                                                           |
  7. |                                                                8/29/93    |
  8. +---------------------------------------------------------------------------+
  9.  
  10. xbrfasm is freeware.  It can be freely distributed as long as this file
  11. accompanies it and the executable is not modified in any way.
  12.  
  13. Using the X-Wing briefing assembler kit (xbrfasm) it is possible to create
  14. mission BRIEFINGS for the LucasArts game from scratch.  I downloaded the
  15. X-Wing design kit from wuarchive.wustl.edu and saw how limited it
  16. was and how toasted the briefings became after 'editing' them when I
  17. decided to come up with my own development kit.  This is the first part
  18. of a set of tools I plan to create to use for modifying X-Wing.
  19. Future tools will include a disassembler for stock mission briefings and an
  20. assembler/disassembler for the missions themselves.
  21.  
  22. If you have any comments or suggestions for xbrfasm feel to drop a line
  23. to the author at the address given above.
  24.  
  25. ** IN ORDER TO USE THIS PROGRAM YOU **MUST** READ THE INSTRUCTIONS. **
  26.  
  27. In order to create a briefing you must learn the assembler's commands
  28. and variable assignments.  Failure to do so will not only result in
  29. no briefing but most likely in frustration at not understanding what
  30. is going on.
  31.  
  32. Disclaimer: Use this program at your own risk.  I've tried to make it as
  33. safe and non-destructive as possible.  If it screws up any of your data
  34. don't blame me.
  35.  
  36. 'Nuff said.  Onto the program's description.
  37.  
  38. 1. PROGRAM EXECUTION:  In order to create a briefing, you must first have
  39. a briefing listing in the form of a text file.  This file contains all
  40. the commands and parameters according to how you want your mission
  41. briefing set up.  Any old DOS editor should work provided it sticks in
  42. newline characters at the end of each line.  I personally use JOVE 4.14
  43. for DOS which allows me to indent and all that.
  44.  
  45. This text file must be in the form "filename.b" (without the quotation
  46. marks, course.)  I chose the ".b" extension to signify that the file
  47. is a Briefing listing.  When run, the assembler will simply add the
  48. letters "RF" to the name of the file thus creating the name of the
  49. assembled briefing (therefore, "defect.b" generates the assembled
  50. briefing file "defect.brf".)
  51.  
  52. To assemble, simply type:
  53.  
  54.     xbrfasm filename.b
  55.  
  56. at the DOS prompt.
  57.  
  58. This program will not overwrite mission briefings that already exist!
  59. If your briefing text file is named "WAZOO.B" and "WAZOO.BRF" exists
  60. in the directory you are currently in, the assembler will exit without
  61. writing.
  62.  
  63. 2. ASSEMBLER COMMANDS:  The assembler has several commands (each described
  64. in detail below) the guide it's operation.  These commands are:
  65.  
  66.     :dump_data            Display a basic dump of the data read in from
  67.                         the briefing file.
  68.  
  69.     :setup,:esetup        Begin/end setup section of the briefing file.
  70.  
  71.     :object_data,        Begin/end object_data section of the briefing.
  72.         :eobject_data
  73.  
  74.     :briefing_setup,    Begin/end setup section of the briefing.
  75.         :ebriefing_setup
  76.  
  77.     :page_data,            Begin/end page_data section of the briefing.
  78.         :epage_data
  79.  
  80.     :tag_data,            Begin/end tag_data section of the briefing.
  81.         :tag_data
  82.  
  83.     :text_data,            Begin/end text_data section of the briefing.
  84.         :etext_data
  85.  
  86.     :efile                End of briefing file.
  87.  
  88. Note that each command is immediately preceded by a colon ":" and
  89. is to be on a line by itself.
  90.  
  91. Of all the commands, :setup,:esetup should come before the other
  92. data definition commands and :efile must be the final command in
  93. the file.  I suggest using the above order to create a sort of
  94. standard if you ever decide to share you briefing sources with
  95. others.
  96.  
  97. 2.1 :dump_data COMMAND:  The :dump_data command dumps all the information
  98. given in the briefing file after it has been successfully read (ie. the
  99. assembler encounters no problems in the reading of the file.)  This
  100. lets the programmer check to see where his/her data is being placed and
  101. if it is being read correctly.
  102.  
  103. 2.2 :setup COMMAND:  The :setup command allows the programmer to set
  104. an initial variable and a variable that really doesn't belong anywhere
  105. else.  These variables are:
  106.  
  107.     number_of_coordinate_sets
  108.     minutes
  109.  
  110. The :esetup command must be used to end the setup section.
  111.  
  112. 2.2.1 number_of_coordinate_sets VARIABLE:  X-Wing briefings allow 1 to
  113. 2 sets of coordinates for displaying ships in the map grid.  If only 1
  114. set is used, it is numbered "0"; two sets are numbered "0" and "1".
  115.  
  116. This variable accepts one parameter, that being a '1' or '2'.
  117. (See view_coord_set, coords0, and coords1 variable descriptions below).
  118.  
  119. 2.2.2 minutes VARIABLE:  This is the number of minutes allowed in the
  120. actual mission.  The length of the mission might not work if this variable
  121. doesn't match the one in the mission file.  This variable accepts
  122. one parameter, being the length in minutes.
  123.  
  124. 2.3 :object_data COMMAND:  The :object_data command allows the programmer
  125. to begin his/her creation of briefing objects.  These objects include
  126. everything from mines to planets to ships.  The only commands found "under"
  127. the :object_data command are :object and :eobject which are used for
  128. defining each individual object.  The :eobject_data command must be
  129. used to exit the object_data area.
  130.  
  131. 2.3.1 :object COMMAND:  The :object command is used to begin the definition
  132. of an object.  The variables that are allowed to follow it are:
  133.  
  134.     name
  135.     cargo
  136.     coords0
  137.     coords1
  138.     reaction
  139.     appearing
  140.     formation
  141.     type
  142.  
  143. The :eobject command must be used to end the definition of the current
  144. object.  NOTE THAT when creating objects, the first object defined is
  145. referenced as "0", the second as "1", and so on in the briefing.
  146. This information will become important when using variables found
  147. under the :command command.
  148.  
  149. 2.3.1.1 name VARIABLE:  This is the name of the object as used in the
  150. briefing.  It accepts one text parameter up to 16 characters long.
  151. This variable defaults to a string of length 0 (null string).
  152.  
  153. 2.3.1.2 cargo VARIABLE: This is the name of the cargo the object is
  154. carrying (if any).  It accepts one text parameter up to 16 characters
  155. long.  This variable defaults to a null string.
  156.  
  157. 2.3.1.3 coords0 VARIABLE: This is set "0" of the coordinates used in
  158. the briefing.  It accepts 3 integer parameters, each separated by at
  159. least on space, representing the X, Y, and Z coordinates of the
  160. object. (see view_coord_set below for more details on coordinate display.)
  161.  
  162. 2.3.1.4 coords1 VARIABLE: As above, this is set "1" of the coordinates
  163. used in the briefing.  It accepts 3 integer parameters, each separated
  164. by at least on space, representing the X, Y, and Z coordinates of
  165. the object.  If only 1 coordinate set is chosen using the :setup
  166. command then any values places in coords1 will be ignored. (see
  167. view_coord_set below for more details on coordinate display.)
  168.  
  169. 2.3.1.5 reaction VARIABLE: This is the type of reaction the object
  170. has (which determines it's coloring [green or red] on the map grid.)
  171. It accepts one text parameter of "default","foe", or "friend".  This
  172. parameter MUST be in lower case (without the quotation marks.)
  173.  
  174. 2.3.1.6 appearing VARIABLE: This is the number of objects appearing.
  175. It accepts one integer parameter.  This value appears to have no
  176. affect on the mission briefing.
  177.  
  178. 2.3.1.7 formation VARIABLE: This is the formation that the objects
  179. fly in.  It accepts one integer parameter.  This value appears to have
  180. no affect on the mission briefing.
  181.  
  182. 2.3.1.8 type VARIABLE: This is the type (ship, planet, or otherwise) of
  183. object that is displayed.  It accepts one text parameter.  This parameter
  184. may be any one of the following (exactly as shown, all in lower case):
  185.  
  186. xwing, ywing, awing, tie fighter, tie interceptor, tie bomber, gunboat,
  187. transport, shuttle, tug, container, freighter, cruiser, frigate,
  188. corvette, star destroyer, tie advanced, mine1, mine2, mine3, mine4,
  189. comm sat, nav buoy, probe, asteroid1, asteroid2, asteroid3, asteroid4,
  190. asteroid5, asteroid6, asteroid7, asteroid8, planet1, planet2, planet3,
  191. planet4, planet5, planet6, planet7, planet8, planet9, planet10, planet11,
  192. planet12, planet13, planet14, death star.
  193.  
  194. 2.4 :briefing_setup COMMAND: The :briefing_setup command sets up the
  195. way that the text and map fields in the briefing are used.  The
  196. programmer is allowed to change the size of the map grid, the number of
  197. rows in the main body of text displayed when the map grid is displayed,
  198. etc.  The top left corner of the display window (the entire area containing
  199. the map grid and text areas) is defined as (X=0,Y=0) and the bottom
  200. left is defined as (X=0, Y=138) although a much larger section can
  201. be defined (but in this case, text will "disappear" by going out of the
  202. range of window.)  The variables used in the briefing_setup section
  203. are:
  204.  
  205.     map_top
  206.     map_bot
  207.     map_set
  208.     full_top
  209.     full_bot
  210.     clock_period
  211.     map_style
  212.  
  213. The :ebriefing_setup command must be used to exit the briefing setup
  214. section.
  215.  
  216. 2.4.1 map_top VARIABLE: This variable defines the top, or heading, of the
  217. of the display window when the map grid appears on the screen.  It accepts
  218. three integer parameters corresponding to the X and Y coordinates and
  219. bottom Y coordinate.  For instance, in most of the stock briefings
  220. map_top is defined as "0 0 12".  This means put the blue background starting
  221. at the top left corner of the display window and extend it down 12.  This
  222. allows for a one-line header.
  223.  
  224. 2.4.2 map_bot VARIABLE: This variable defines the bottom, or sub-heading,
  225. of the display window when the map grid appears on the screen.  It accepts
  226. three integer parameters corresponding to the X and Y coordinates and
  227. bottom Y coordinate.  For most stock briefings, this is two lines long.
  228.  
  229. 2.4.3 map_set VARIABLE: This variable defines the area of the display
  230. window taken up by the map grid.  It accepts three integer parameters
  231. corresponding to the X and Y coordinates and bottom Y coordinate.  The
  232. top Y coordinate usually equals the bottom Y coordinate of map_top
  233. and the bottom Y coordinate usually equals the top Y coordinate of
  234. map_bot (it's basically "sandwiched" between those two variables.)
  235.  
  236. 2.4.4 full_top VARIABLE: This variable defines the top, or heading, of
  237. the display window when the game player is viewing the full text of
  238. explanation of the briefing.  It accepts three integer parameters
  239. corresponding to the X and Y coordinates and bottom Y coordinate.
  240.  
  241. 2.4.5 full_bot VARIABLE:  This variable defines the main section of
  242. display window taken up by the full text description explanation of
  243. the briefing.  It accepts three integer parameters corresponding to
  244. the X and Y coordinates and bottom Y coordinate.
  245.  
  246. 2.4.6 clock_period VARIABLE:  This variable defines the clock period,
  247. or number of time segments, used by the briefing.  It accepts one
  248. integer parameter valued from 0 to 9999.
  249.  
  250. During the map grid display (and as long as the STOP button hasn't
  251. been "pressed") actions take place.  For instance, an identification
  252. box (or id as I call it) may drop down on several (actually it's as
  253. many as four) different objects.  The briefing uses timed events to
  254. either drop the ids separated by a few seconds (as in DEFECT.BRF's id'ing
  255. of the Imperial FRTs) or at the same time (as in DEFECT.BRF's id'ing
  256. of the Y-Wing fighters.)  The clock_period is the value at which
  257. all events end.  (see :commands command for more information.)
  258.  
  259. 2.4.7 map_style VARIABLE: This variable defines the style of the
  260. map grid.  It accepts one text parameter entered as "space" or
  261. "surface" (note that the paramter must be entered in lower case
  262. without the quotation marks.)  If "space" is chosen, the color of
  263. the map grid is black.  If "surface" is chosen, the color of the
  264. map grid will be light blue/gray signifying the surface of the
  265. Death Star.
  266.  
  267. 2.5 :page_data COMMAND:  This command denotes the beginning of page
  268. definitions.  The commands that can be used under it are:
  269.  
  270.     :page
  271.     :epage
  272.  
  273. The :epage_data command must be used to exit the page data definition
  274. section.
  275.  
  276. 2.5.1 :page COMMAND:  This command is used to define a page.  A page
  277. corresponds to each page of the briefing (for example, in DEFECT.BRF,
  278. there are 3 pages - the 1st page has a map grid and has the general
  279. overview of the mission, the 2nd and 3rd pages are full text descriptions
  280. of the mission.)  The variable and commands that can be used under
  281. :page are:
  282.  
  283.     view_coord_set
  284.     :commands
  285.     :ecommands
  286.  
  287. The :epage command must be used to end the definition of a page.  Note
  288. that the first page definition will use the values in map_top,
  289. map_bot, and map_set to define the display window while subsequent
  290. page definitions will use the values in full_top and full_bot to
  291. define the display window.
  292.  
  293. 2.5.1.1 view_coord_set VARIABLE: This variable defines which set of
  294. object coordinates are viewed for the page.  It accepts one integer
  295. parameter of either a "0" or a "1" depending on the set that is
  296. to be displayed.  If "0" is chosen, the values from the objects variable
  297. coords0 are used.  If "1" is chosen, the values from the objects variable
  298. coords1 are used.
  299.  
  300. 2.5.1.2 :commands COMMAND:  The :commands command is used to begin
  301. definition of a command list that is executed by the briefing.  The
  302. variables (or command directives) that can be used under :commands
  303. are:
  304.  
  305.     header
  306.     main
  307.     center
  308.     zoom
  309.     a_tag
  310.     b_tag
  311.     c_tag
  312.     d_tag
  313.     a_id
  314.     b_id
  315.     c_id
  316.     d_id
  317.     clear_text
  318.     clear_tags
  319.     clear_ids
  320.     end_cmds
  321.  
  322. The :ecommands command must be used to exit the command list definition.
  323.  
  324. 2.5.1.2.1 header VARIABLE:  This defines which text string is placed in
  325. the area as defined by the values in map_top or full_top.  It accepts
  326. two integer parameters, the first of which is the time segment it is
  327. executed at and the second of which is the id number of the text string
  328. (see the :text_data command below) to be displayed.
  329.  
  330. 2.5.1.2.2 main VARIABLE: This defines which text string is placed in
  331. the area as defined by the values in map_bot or full_bot.  It accepts
  332. two integer parameters, the first of which is the time segment it is
  333. executed at and the second of which is the id number of the text string
  334. (see the :text_data command below) to be displayed.
  335.  
  336. 2.5.1.2.3 center VARIABLE: This defines where to place the center
  337. position of the map grid.  It accepts three integer parameters:
  338. time segment of execution, X coordinate, and Y coordinate.  Changing
  339. the center of the map grid creates the panning effect found in many
  340. of the briefings.
  341.  
  342. 2.5.1.2.4 zoom VARIABLE: This defines the zooming in and out of the
  343. map grid.  It accepts three integer parameters: time segment of
  344. execution, X zoom factor, and Y zoom factor.  X and Y zoom factors
  345. of 8 cause the map grid to have no subdivisions.  Numbers greater
  346. than 8 zoom in; numbers less than 8 zoom out.  Factors of 0
  347. cause X-Wing to crash.
  348.  
  349. 2.5.1.2.5 a_tag through d_tag VARIABLES:  These display map tags (see
  350. :tag_data below) on the map grid.  They accept four integer parameters:
  351. time segment of execution, tag number, X coordinate, and Y coordinate.
  352. Note that only a total of four tags may be displayed at a time on the
  353. map grid (thus the a_tag, b_tag, c_tag, and d_tag differentiation.)  The
  354. letters that precede these variables are for clarification purposes only.
  355. In order to display more tags, the clear_tags variable/command directive
  356. must be issued to get rid of the current tags.
  357.  
  358. 2.5.1.2.6 a_id through d_id VARIABLES:  These place an identification
  359. box on the specified object.  They accept two integer parameters:
  360. time segment of execution and object identification number (see
  361. :object_data for more information.)  The letters that precede these
  362. variables are for clarification purposes only and do not in any way
  363. correspond to the variables in 2.5.1.2.5.  A total of 4 id's are
  364. allowed displayed.  To display more id's, the clear_ids variable/command
  365. directive must be issued to get rid of the current ids.
  366.  
  367. 2.5.1.2.7 clear_text VARIABLE: This variable clears the text areas of
  368. the display window (ie. the heading and main body).  It accepts
  369. one integer parameter corresponding to the time segment of execution.
  370. This command must be issued before any new text can displayed.  It
  371. is generally followed by a heading variable/command directive and
  372. main variable/command directive.
  373.  
  374. 2.5.1.2.8 clear_ids VARIABLE: This variable clears the identification
  375. boxes from the map grid.  It accepts one integer parameter corresponding
  376. to the time segment of execution.  This command must be used if there
  377. are currently four ids being displayed and the programmer wishes to
  378. make more ids.
  379.  
  380. 2.5.1.2.9 clear_tags VARIABLE: This variable clears the tags from
  381. the map grid.  It accepts one integer parameter corresponding
  382. to the time segment of execution.  This command must be used if there
  383. are currently four tags being displayed and the programmer wishes to
  384. display more tags.
  385.  
  386. 2.5.1.2.10 end_cmds VARIABLE: This is a REQUIRED variable for the end of each
  387. page definition.  It accepts one integer parameter corresponding
  388. to the time segment of execution.  Even though in stock briefings
  389. the clock period isn't as large as 9999, this is what has been used
  390. and what I advise programmers to use "to be on the safe side."  I
  391. haven't done any bounds testing with this variable/command directive
  392. so I don't know what happens if it isn't set to 9999.
  393.  
  394. 2.6 :tag_data COMMAND: This command denotes the beginning of the
  395. definitions of tags that are displayed on the map grid.  One
  396. variable can be used under it (but this one variable can be used a
  397. number of times):
  398.  
  399.     tag
  400.  
  401. The :etag_data command must be used to exit the tag data definition
  402. section.
  403.  
  404. 2.6.1 tag VARIABLE: This variable defines a string of text that is
  405. used by the :commands variables/command directives a_tag through
  406. d_tag.  It accepts one text parameter.  Any newline characters found
  407. after the definition are erased.  Each time this variable is used a
  408. new tag is created without destroying any previous tags.  The first
  409. tag definition is referenced as "0", the second definition is
  410. referenced as "1", and so on.  These references are used in the
  411. :commands sections.
  412.  
  413. 2.7 :text_data COMMAND: This command denotes the beginning of the
  414. definitions of text strings that are displayed in the blue text
  415. areas of the display window.  One variable can be used under it (but
  416. this one variable can be used a number of times to create several
  417. text strings):
  418.  
  419.     text
  420.  
  421. The :etext_data command must be used to exit the text data definition
  422. section.
  423.  
  424. 2.7.1 text VARIABLE: This variable defines a block of text that is used
  425. by the :commands variables/command directives main and header.  It
  426. accepts one text parameter.  A blank line signifies the end of the
  427. text definition.  Any newline characters found in the definition
  428. lines are erased.  A greater-than sign ">" will cause subsequent
  429. text to be printed in yellow in the briefing (used almost exclusively
  430. for headers) -- the briefing interprets this.  Green highlighting can be
  431. turned on/off by using the carat symbol "^".  For example, if the text string
  432. desired is "Look out for Darth Vader's Star Destroyer" and the programmer
  433. wants "Darth Vader's" to be highlighted in green, he/she would enter the
  434. string as "Look out for ^Darth Vader's^ Star Destroyer".  The assembler
  435. will create the appropriate highlighting and discard the "^"s before
  436. creating the briefing file.
  437.  
  438. The first text string defined is referenced as "1", the second is
  439. referenced as "2" and so on.  Note that this is different from how
  440. tags are referenced and pages are referenced (both starting at
  441. "0" rather than "1").
  442.  
  443. 2.8 :efile COMMAND: This command denotes the end of the file and
  444. causes the assembler to begin dumping data (if requested) and
  445. writing/creating the briefing file.
  446.  
  447. 3.0 BRIEFING INFORMATION:  In order to use your briefing -- back up a
  448. briefing and rename your briefing to the briefing you just backed up.
  449.  
  450. Here is a list of Tours of Duty and Historical Missions file names:
  451. (Thanks to Henry Chang for supplying this with his X-Wing Design Kit)
  452.  
  453. Tour Of Duty 1        Tour Of Duty 2        Tour of Duty 3
  454. Op. Name            Op.    Name            Op.    Name
  455. 1    DEFECT            1    STARSNDB        1    DEFEND2
  456. 2    ID-RECON        2    RESCUE1            2    YRAID
  457. 3    WXRGARD1        3    YSTRIKE5        3    MAX14
  458. 4    WXPROT2            4    WYCAPT2            4    MAX17
  459. 5    ATTACKXY        5    MAX9            5    WYRESC3
  460. 6    MAX13            6    CRNDRFT1        6    LARRY1
  461. 7    MAX10            7    MAX18            7    LARRY2
  462. 8    ATTACK3            8    MAX1            8    LARRY3
  463. 9    SULLUST            9    STD1            9    ASSAULT2
  464. 10    ACK-HARD        10    STD2            10    MAX19
  465. 11    CYGNUS            11    LEIA            11    DEFEND1
  466. 12    MAX20            12    INTCEP1            12    DSTAR1
  467.                                         13    DSTAR2
  468.                                         14    DSTAR3
  469.  
  470. Historical Missions
  471. XWING            YWING            AWING
  472. 1    WAISTEM        1    YWASTEM        1    AWAISTEM
  473. 2    MAX4        2    YWAISTEM    2    WAAGGR1
  474. 3    SATLIT1        3    HELLO        3    MAX2
  475. 4    MAX5        4    MAX7        4    CONVOY2
  476. 5    HALLEY        5    WYRESC2        5    MAX15
  477. 6    KEYAN        6    ACKBAR        6    WARECON1
  478.  
  479. 3.1 I have included in this package the "DEFECT.B" which, when assembled,
  480. performs similar, if not exactly the same as, the DEFECT.BRF briefing
  481. included with X-Wing.  View it as an example on how to set up your own
  482. briefings.
  483.  
  484. Have fun, and may the force be with you!
  485.  
  486. --tim
  487.